package com.tdzh.maimaiti.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 * <p/>
 * TODO: Replace all uses of this class before publishing your app.
 */
public class RequestContent{

    /**
     * An array of sample (dummy) items.
     */
    public static final List<RequestItem> ITEMS = new ArrayList<>();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static final Map<String, RequestItem> ITEM_MAP = new HashMap<>();

   // private static final int COUNT = 25;

/*    public static List<RequestItem> create(){
        // Add some sample items.
       // if(ITEMS.size() == 0){ System.out.print("i have been working"); }
      //  else{
            for (int i = 1; i <= ITEMS.size(); i++) {
            addItem(createRequestItem(i));
             }
      //  }
        return ITEMS;
    }*/

    public static void addItem(RequestItem item) {
        ITEMS.add(item);
        ITEM_MAP.put(item.id, item);
    }

    public static class RequestItem  implements Serializable{
        public final String id;
        public final String title;
        public final String details;
        public final String requester;
        public final String sort;
        public ArrayList<Map<String, Object>> answerItems;

        public RequestItem(String id, String content, String details, String requester, String sort, ArrayList<Map<String, Object>> answerItems) {
            this.id = id;
            this.title = content;
            this.details = details;
            this.requester = requester;
            this.sort = sort;
            this.answerItems = answerItems;
        }

        @Override
        public String toString() {
            return title;
        }
    }


}
